var app = getApp();
Page({
    data:{
      orderId:"",
      orderDetail: {},
      goodsPrice:0,
      fileServerPath: app.globalData.fileServerPath
    },

    onLoad:function(e){
      var orderId = e.id;
      wx.request({
        url: app.globalData.rootPath + '/m/order/' + orderId,
        data: {
          token: wx.getStorageSync('token'),
        },
        success: (res) => {
          if(res.data.meta.code === 200){
            this.setData({
              orderDetail: res.data.data,
              goodsPrice: (res.data.data.order_price - res.data.data.freight_price).toFixed(2)
            });
          }else{
            wx.showModal({
              title: '提示',
              content:res.data.meta.message,
              showCancel: false
            })
          } 
        }
      })
    }
})